// 获取所有分类
export const reqCategoryList = () =>
  request({ url: "/category", method: "get" });

// 添加或修改分类
export const reqAddOrUpdateCategory = (data) => {
  if (data.id) {
    return request({ url: "/category", method: "put", data });
  } else {
    return request({ url: "/category", method: "post", data });
  }
};

// 删除分类
export const reqDeleteCategory = (data) =>
  request({ url: "/category", method: "delete", data });
